package reflect;

import java.lang.reflect.Method;

public class ReflectDemo10 {
    public static void main(String[] args) throws Exception {
        Class clas = Class.forName("reflect.Person");
        Method method = clas.getMethod("sleep");
        boolean mark  = method.isAnnotationPresent(AutoRunMethod.class);
        if (mark){
            System.out.println(method.getName()+"()方法被标注了");
        }else {
            System.out.println(method.getName()+"()方法没有被标注");
        }
    }
}
